package com.lxl.xm.mapper;

import com.lxl.xm.model.dto.student.FaceStudentInfo;
import com.lxl.xm.model.entity.Student;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
* @author 86135
* @description 针对表【student(`student`)】的数据库操作Mapper
* @createDate 2024-01-31 16:32:42
* @Entity com.lxl.model.entity.Student
*/
@Mapper
public interface StudentMapper extends BaseMapper<Student> {

    @Select("SELECT province, COUNT(*) AS count FROM student GROUP BY province")
    List<Map<String, Object>> countStudentsByProvince();

    @Select("SELECT department, COUNT(*) AS count FROM student GROUP BY department")
    List<Map<String, Object>> countStudentsByCollege();

    List<FaceStudentInfo> getUserFaceInfoByGroupId(Integer groupId);

    Student selectStudentByIdCard(String idCard);
}




